;
(function() {
  'use strict';
  angular.module('services.faultLocation.appAlarmServer')
    .factory('endDetailedServer', endDetailedServer)
    .factory('endAnalysisServer', ['Restangular','$filter',
      function(Restangular,$filter) {
        var messages = {};
        var items={};
        return {
          setMessage: function(value) {
            messages = value;
          },
          getMessage: function() {
            return messages;
          },
          setitems: function(value) {
            items = value;
          },
          getitems: function() {
            return items;
          },

          provinceQuery: function(callback) {
            Restangular.one('sas/common/provinceQuery').get().then(callback);
          },

          systemQuery: function(callback) {
            Restangular.one('sas/common/sysQuery').get().then(callback);
          },
          //查询业务名称
          businessQuery: function(params) {
            return Restangular.all('sas/common/businessQuery').post(params);
          },
          //端到端对比分析查询
          queryTime: function(params, callback) {
            Restangular.all('sas/faultLocation/endToEnd/queryTime').post(params).then(callback);
          },
          //端到端列表查询
          detQuery: function(param, callback) {
            var params={};
            angular.copy(param,params);
            params.date=$filter('date')(param.date ,'yyyyMMdd');
            Restangular.all('sas/faultLocation/endToEnd/detQuery').post(params).then(callback);
          },
          //端到端详细查询
          compare: function(params, callback) {
            Restangular.all('sas/faultLocation/endToEnd/compare').post(params).then(callback);
          },
        };
      }
    ]);


  function endDetailedServer() {
    return {
       param :{
          systemCode: '11',
          businessCode: '01',
          provinceCode: '200',  
          sortState:'1',
          serialNum: '',
          date:  new Date()
        }
    }

  }
})();